package com.shadow.demo.shiro.dto;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

@Data
@Accessors(chain = true)
public class PermissionDTO {

    private String id;

    private String parentId;

    /** 权限名 */
    private String name;

    private String text;

    /** 权限符 */
    private String code;

    private String icon;

    private String link;

    /** 排序号 */
    private Integer orderNum;

    private List<PermissionDTO> children;

    public PermissionDTO addChildren(final PermissionDTO permissionDTO) {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        this.children.add(permissionDTO);
        return this;
    }
}
